//
//  MineCell.m
//  RoadLine
//
//  Created by dllo on 15/4/29.
//  Copyright (c) 2015年 RedFireNoodles. All rights reserved.
//

#import "MineCell.h"
#import "Singleton.h"
#import "NightManager.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height


@implementation MineCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

    if (self) {
        self.view = [[UIView alloc] init];
        self.view.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:self.view];
        
        self.image = [[UIImageView alloc] init];
        [self.view addSubview:self.image];
        self.image.backgroundColor = [UIColor clearColor];
       
        self.label = [[UILabel alloc] init];
//        self.label.backgroundColor = [UIColor clearColor];
//        self.label.layer.cornerRadius = 8;
        [self.view addSubview:self.label];
        
        [self.contentView bringSubviewToFront:self.view];
    }
     return self;
}


-(void)layoutSubviews{

    [super layoutSubviews];
    self.view.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
    self.image.frame = CGRectMake(15, 15, 20, 20);
    self.label.frame = CGRectMake(40, 10, WIDTH - 50, 20);

    // 夜间模式
    if ([Singleton shareSingleton].isNight) {
        [[Singleton shareSingleton] loadNightModeInfoFormDisk];
    }
}


- (void)setLightDayModel {
    self.label.textColor = [UIColor blackColor];
    self.label.backgroundColor = [UIColor clearColor];
    self.contentView.backgroundColor = [UIColor clearColor];
}


- (void)setNightDayModel {
    self.label.textColor = [UIColor whiteColor];
    self.label.backgroundColor = [UIColor blackColor];
    self.contentView.backgroundColor = [UIColor blackColor];
}

-(void)dealloc{
    [_image release];
    [_label release];
    [_view release];
    [super dealloc];
}






@end
